package com.panasonic.web.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panasonic.web.domain.cms.CmsExamExaminee;
import com.panasonic.web.domain.cms.CmsExamScore;
import com.panasonic.web.vo.CmsExamRecordAnswerVo;
import com.panasonic.web.vo.CmsExamReviewParameter;
import com.panasonic.web.vo.CmsExamReviewRequestVo;
import com.panasonic.web.vo.CmsExamReviewVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 考试分数Mapper接口
 * 
 * @author lwf
 * @date 2021-11-16
 */
public interface CmsExamScoreMapper
{
    /**
     * 查询考试分数
     * 
     * @param id 考试分数ID
     * @return 考试分数
     */
    public CmsExamScore selectCmsExamScoreById(Long id);

    /**
     * 查询考试分数列表
     * 
     * @param cmsExamScore 考试分数
     * @return 考试分数集合
     */
    public List<CmsExamScore> selectCmsExamScoreList(CmsExamScore cmsExamScore);

    /**
     * 新增考试分数
     * 
     * @param cmsExamScore 考试分数
     * @return 结果
     */
    public int insertCmsExamScore(CmsExamScore cmsExamScore);

    /**
     * 修改考试分数
     * 
     * @param cmsExamScore 考试分数
     * @return 结果
     */
    public int updateCmsExamScore(CmsExamScore cmsExamScore);

    /**
     * 删除考试分数
     * 
     * @param id 考试分数ID
     * @return 结果
     */
    public int deleteCmsExamScoreById(Long id);

    /**
     * 批量删除考试分数
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteCmsExamScoreByIds(Long[] ids);

    /**
     * 获取批阅列表
     * @param examId
     * @return
     */
    List<CmsExamReviewVo> getReviewList(CmsExamReviewParameter parameter);

    /**
     * 获取考试记录
     * @param examId
     * @param userId
     * @return
     */
    CmsExamScore getScoreByExamIdAndUserid(@Param("examId") long examId,@Param("userId") Long userId);
    CmsExamScore getScoreByExamIdAndUseridAndTimes(@Param("examId") long examId,@Param("userId") Long userId,@Param("times")int times);

    List<CmsExamRecordAnswerVo> selectReviewListByUser(CmsExamReviewRequestVo requestVo);

    List<CmsExamScore> selectScoreByExamIds(@Param("examIds") List<Long> examIds, @Param("userId") Long userId);

    int getLastExamTimes(@Param("examId")long examId, @Param("userId") Long userId);

    void deleteCmsExamScoreByExamId(@Param("examId") long examId);
}
